<template>
  <el-button
    type="success"
    @click="handleNext"
    style="padding: 8px 8px 6px 16px; font-weight: bolder"
  >
    <span style="padding-right: 8px">下一步</span>
    <el-icon><i-ep-arrow-right /></el-icon>
  </el-button>
</template>

<script setup>
import usePlanningStore from "@/stores/planningStore";
const planningStore = usePlanningStore();

const props = defineProps({
  beforeNext: {
    type: Function,
    default: () => true,
  },
});

const handleNext = () => {
  if (!props.beforeNext()) {
    return;
  }
  planningStore.currentStep++;
};
</script>
